(function () {
    let myChart = echarts.init(document.querySelector('.box:nth-of-type(1)'))
    let option = {
        title: {
            text: '百分比'
        },
        xAxis: {
            show: false,
        },
        yAxis: {
            type: 'category',
            data: ['字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称', '字段名称',],
            axisLabel: {
                color: "#9a9fb4",
                fontSize: "14"
            },
            "axisLine": {
                "show": false
            },
            "axisTick": {
                "show": false
            },
        },
        grid: {
            left: 100,
            bottom: 8
        },
        series: [
            {
                data: [57, 47, 28, 84, 39, 19, 12, 99, 67, 80, 49],
                type: 'bar',
                showBackground: true,
                color: '#6abaf2',
                backgroundStyle: {
                    color: '#1e2a6a'
                },
                label: {
                    show: true,
                    position: "outside",
                    color: '#65b1e9',
                    fontWeight: 'bold',
                    formatter: "{c}%"
                },
            }
        ]
    };

    myChart.setOption(option)
    window.addEventListener('resize', () => {
        myChart.resize()
    })
})()